﻿<phone:PhoneApplicationPage 
    x:Class="OnlineVideos.Views.RingTone"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:slider="clr-namespace:tooltipslider;assembly=OnlineVideos.TooltipSlider"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="White"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">


    <Grid x:Name="MainGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="80"/>
        </Grid.RowDefinitions>
        <Grid>
            <!--LayoutRoot is the t grid where all page content is placed-->
            <Grid x:Name="LayoutRoot" Grid.Row="0" Background="{StaticResource bipivot}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>

                </Grid.RowDefinitions>
                <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="12,17,0,10">
                    <Image Style="{StaticResource DetailPagePivotTitleImage}" x:Name="imgTitle" MouseLeftButtonDown="imgTitle_MouseLeftButtonDown"/>

                    <TextBlock   x:Name="tblkVideosTitle"  Text="CREATE RINGTONE"  TextWrapping="NoWrap" Style="{StaticResource DetailPagePivotTitle}"/>
                </StackPanel>
                <!--TitlePanel contains the name of the application and page title-->


                <!--ContentPanel - place additional content here-->
                <Grid x:Name="ContentPanel" Grid.Row="1">
                    <Grid x:Name="Playergrid" Background="Transparent">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel Orientation="Vertical" Grid.Row="0">
                            <Canvas Height="100">
                                <TextBlock  x:Name="txtTitle" FontSize="30" Height="62" Width="200" HorizontalAlignment="Left" Margin="30,10,0,0"  ></TextBlock>
                                <slider:MainControl   ManipulationStarted="ringtoneslider_ManipulationStarted" ManipulationCompleted="ringtoneslider_ManipulationCompleted" Margin="0,10,0,0"  x:Name="ringtoneslider" Width="480"></slider:MainControl>

                            </Canvas>

                        </StackPanel>
                        <MediaElement x:Name="mymedia"  MediaEnded="mymedia_MediaEnded" Volume="1" AutoPlay="True" Visibility="Collapsed" Width="0" Height="0" MediaOpened="mymedia_MediaOpened">
                        </MediaElement>
                        <StackPanel Grid.Row="1" Margin="0,20,0,0" Orientation="Horizontal">
                            <Image  Source="/Images/PlayerImages/rewind.png" x:Name="Rewindimage"  Height="64" Margin="30,0,0,0" Width="64" MouseLeftButtonDown="Rewindimage_MouseLeftButtonDown"  MouseLeftButtonUp="Rewindimage_MouseLeftButtonUp"></Image>
                            <Image x:Name="playimage"  Height="64" Margin="110,0,0,0" Width="64" MouseLeftButtonDown="playimage_MouseLeftButtonDown"></Image>
                            <Image Source="/Images/PlayerImages/fastforward.png" x:Name="forwardimage" MouseLeftButtonDown="forwardimage_MouseLeftButtonDown" MouseLeftButtonUp="forwardimage_MouseLeftButtonUp"  Height="64" Margin="115,0,0,0" Width="64"></Image>
                        </StackPanel>
                        <StackPanel Orientation="Vertical" Grid.Row="2">
                            <StackPanel Orientation="Horizontal" Margin="0,25,0,0">
                                <Canvas x:Name="Begincanvas"  Margin="10,15,10,10" Width="180" Height="72" >
                                    <Rectangle x:Name="Rctbegin" Fill="#43C6" Stroke="Black"  StrokeThickness="5" Width="180" Height="72" RadiusX="20" RadiusY="20">
                                    </Rectangle>
                                    <Button x:Name="btnbegin" BorderBrush="Transparent"   Content="Begin Time" Height="72" FontSize="25" Width="180" Canvas.Left="0" Canvas.Top="-1" Click="btnbegin_Click" />
                                </Canvas>
                                <TextBox  x:Name="tbbegin" VerticalAlignment="Center" BorderBrush="Transparent" Height="82" Width="120"  LostFocus="tbbegin_LostFocus" ></TextBox>
                                <TextBlock x:Name="txtbegin"  Height="22" Width="100" Text="Secs" VerticalAlignment="Center" ></TextBlock>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
                                <Canvas Margin="10,10,10,10" Width="180" Height="72">
                                    <Rectangle x:Name="Rctend"  Fill="#43C6" Stroke="Black" StrokeThickness="5" Width="180" Height="72" RadiusX="20" RadiusY="20">
                                    </Rectangle>
                                    <Button x:Name="btnend" BorderBrush="Transparent"   Content="End Time" Height="72" FontSize="25" Width="180" Canvas.Left="0" Canvas.Top="-1" Click="btnend_Click" />
                                </Canvas>
                                <TextBox  VerticalAlignment="Center" x:Name="tbend" BorderBrush="Transparent" Height="82" Width="120"  LostFocus="tbend_LostFocus"></TextBox>
                                <TextBlock x:Name="txtend"  Height="22" Width="100" Text="Secs"></TextBlock>
                            </StackPanel>

                            <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                                <TextBlock x:Name="txtdurationlabel"  Height="62" Width="110" VerticalAlignment="Center" Text="Duration:" FontSize="25" Margin="20,0,0,0"></TextBlock>
                                <TextBlock  VerticalAlignment="Center" x:Name="txttimerange" Height="62" Width="125"  FontSize="25" ></TextBlock>

                                <StackPanel Orientation="Horizontal">
                                    <TextBlock x:Name="txtfile"  Height="62" Width="110" Text="File Size :" FontSize="25"  VerticalAlignment="Center" Margin="15,0,0,0"></TextBlock>
                                    <TextBlock   VerticalAlignment="Center" x:Name="txtfilesize" Height="62" Width="90"  FontSize="25" ></TextBlock>

                                </StackPanel>
                            </StackPanel>

                            <TextBlock x:Name="txterror" TextWrapping="Wrap" Height="69" Width="454" Margin="0,0,0,0" Foreground="Red"   FontSize="25" ></TextBlock>
                        </StackPanel>

                    </Grid>
                </Grid>



            </Grid>
            <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
                <TextBlock Text="Loading Song" FontSize="25" x:Name="ringtoneloadingmessage" HorizontalAlignment="Center" ></TextBlock>
                <toolkit:PerformanceProgressBar VerticalAlignment="Center" Width="400" x:Name="performanceProgressBar"/>
            </StackPanel>

        </Grid>
        <StackPanel Name="adstaRing" Grid.Row="1" Orientation="Vertical"  Margin="-4,0,0,0">
        </StackPanel>

    </Grid>
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>

        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="btnpreview" IconUri="/Images/appbar.transport.play.rest.png" Text="Preview"  Click="btnPreview_Click"/>
            <shell:ApplicationBarIconButton x:Name="btnsave" IconUri="/Images/PlayerImages/save.png" Text="Save" Click="ApplicationBarIconButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="btncancel" IconUri="/Images/PlayerImages/cancel.png" Text="Cancel" Click="ApplicationBarIconButton_Click_1"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
